export function formatDate(e) {
  try {
    if (!(e instanceof Date)) {
      e = new Date(e);
    }
    let year = e.getFullYear();
    let month = e.getMonth() + 1;
    let data = e.getDate();

    return [year, month, data]
      .map((v) => {
        return (v + "").length > 1 ? v : "0" + v;
      })
      .join("/");
  } catch (error) {
    throw new Error(e + "必须是符合日期格式的字符串，或者时间戳，或者日期对象");
  }
}
